<style lang="less" scoped>
    .main {
        margin-bottom: 0.35rem;
        background: #fff;
        padding: 0 0.38rem;

    input {
        width: 100%;
        background: transparent;
        font-size: 0.37rem;
        color: #222;
        height: 1rem;
        border-bottom: 1px solid #dbdbdb;

    &:last-child {
         border-bottom: 0;
     }

    }
    }
    .on_b {
        button{
            height:0.8rem;
            padding: 0;
        }
    }
    .tip{
        padding-left: 0.24rem;
    }
</style>
<template>
    <div>
        <v-header title="填写资历信息">
            <div slot="left">
                <div class="backs_icon"></div>
            </div>
            <!--<div slot="right" class="lordfontColor" v-on:click="sava">保存</div>-->
        </v-header>
        <div class="main_allScroll" :style="{top:interactive.statusBarHeight.height}">
        <div class="tip">
            <div class="warning_icon"></div>
            <span>请填写您的真实信息，通过后不能修改!</span>
        </div>
        <div class="main">
            <input type="text" placeholder="企业名称" v-model="date.enterpriseName">
            <input type="text" placeholder="企业代码" v-model="date.enterpriseCode">
        </div>
        <div class="on_b">
            <button class="btns buttonBR" :class="disabled" :disabled="disabled !== ''" v-on:click="next">
                <span>下一步</span>
            </button>
        </div>
        <div class="on_b" style="margin-top: 0.24rem;color: #ababab;font-size: 0.24rem">以上信息用于商家认证</div>
        </div>
    </div>
</template>
<script>
    import {mapActions, mapState} from 'vuex'
    export default {
        data() {
            return {
                date:{
                    enterpriseName:'',
                    enterpriseCode:''
                },
                disabled:'disabled'
            };
        },
        activated:function () {
            let data = window.localStorage.getItem('addBusiness');
            if(data && data !== {}){
                Object.assign(this.date, JSON.parse(data));
            }
            /*if(this.user.authentication === 0){
                this.$router.push({path:"/my/verified"})
            }*/
        },
        deactivated:function () {
                window.localStorage.setItem('addBusiness',JSON.stringify(this.date));
        },
        methods:{
            next(){
                this.$router.push({path:"/my/business/businessLicense"})
            }
        },
        watch:{
            'date.enterpriseName':function () {
                if(this.date.enterpriseName.trim() && this.date.enterpriseCode.trim()){
                    this.disabled = ''
                }
            },
            'date.enterpriseCode':function () {
                if(this.date.enterpriseName.trim() && this.date.enterpriseCode.trim()){
                    this.disabled = ''
                }
            }
        },
        computed: mapState({interactive: state => state.interactive}),
    }
</script>